<?php
class FrmUserServices{
	private $ajax;
	private $editor;
	private $moving;
	
	private $divTabs;
	private $tabsBox;
	private $divContent;
	
	private $setter;
	private $form;
	private $iconBox;
	
	private $frmInicial;
	
	function FrmUserServices(){
		$this->setter=new Setter("../../Config");
		
		$this->ajax=new Ajax();
		$this->ajax->activate();
		$this->ajax->GETMethodSend();
		$this->ajax->POSTMethodSend();
		$this->ajax->tableInfoPOSTMethodSend();
		
		$this->editor=new Editor("http://localhost/weblinx/tinymce/jscripts/tiny_mce/tiny_mce.js","textareas","simple","es");
		$this->editor->activate();
		
		$this->moving=new DivMoving();
		$this->moving->activate();
			
		$this->divTabs=new Div("tabs","tabs","tabsContainer",array(),"","","","","");
		$this->tabsBox=new IconBox("15","100","0","0","","tabsContainer","tab");
		
		if(in_array("Invited",$_SESSION['sections'])){
			$this->tabsBox->addIcon("Invitado", "Invitado", "Invitado", "Invitado", "Invitado", "", "Invitado, registrese, es gratis!","button",array("onClick"=>"GETMethodSend(this.id,'content','../../Events/UserServices/EventsFrmUserServices.php')"));
			$this->frmInicial=new FrmInvitados();
		}
		
		if(in_array("Administrator",$_SESSION['sections'])){
			$this->tabsBox->addIcon("Admin", "Admin", "Admin", "Admin", "Admin", "", "Admin","button",array("onClick"=>"GETMethodSend(this.id,'content','../../Events/UserServices/EventsFrmUserServices.php')"));
			$this->frmInicial=new FrmAdmin();
		}
		
		if(in_array("Embargoes",$_SESSION['sections'])){
			$this->tabsBox->addIcon("Embargos", "Embargos", "Embargos", "Embargos", "Embargos", "", "Embargos","button",array("onClick"=>"GETMethodSend(this.id,'content','../../Events/UserServices/EventsFrmUserServices.php')"));
			$this->frmInicial=new FrmAdmin();
		}
		
		$this->divContent=new Div("content","content","content",array(), "","","","","");
		
		
		$this->form=new Form("frmSystem","frmSystem","post","../../Events/UserServices/EventsFrmUserServices.php");
		$this->iconBox=new IconBox("48","48","4","4","yes","container","icon");
		$this->iconBox->addIcon("close","close","close","close","cerrar","../../Themes/".$this->setter->getTheme()."/Images/close.png","Cerrar SCI","submit",array());
		
		$this->iconBox->addLink("help","help","../../Data/userManual.pdf","","Ayuda","yes","800px","600px","100","100","0","0","0","0","0","2","0","../../Themes/".$this->setter->getTheme()."/Images/help.png","Ayuda","linker",array());
		
		//if(count($_SESSION['sections'])!=1){
			$this->iconBox->addLink("userConf","userConf","../../Events/UserServices/EventsFrmUserServices.php?userConf=yes","","Usuario","yes","600px","260px","100","100","0","0","0","0","0","2","0","../../Themes/".$this->setter->getTheme()."/Images/userConf.png","Usuario","linker",array());
		//}
		
		//$this->iconBox->addIcon("help","help","help","help","Ayuda","../../Themes/".$this->setter->getTheme()."/Images/help.png","Ayuda","submit",array());
		//$this->iconBox->addIcon("userConf","userConf","userConf","userConf","Usuario","../../Themes/".$this->setter->getTheme()."/Images/userConf.png","Informacion del usuario","submit",array());
		
	}
	
	function show(){
		$this->divTabs->start();
			$this->tabsBox->show(1,count($_SESSION['sections']));
		$this->divTabs->end();
		$this->divContent->start();
			$this->frmInicial->show();
		$this->divContent->end();
		
		//Formulario del sistema-------
		$this->form->start();
			$this->iconBox->show(1,3);
		$this->form->end();
		//-----------------------------
		
	}
	
	
}
?>
